
var getUserName = getCookie( "userName" );   //模拟取数据
var getUserPass = getCookie( "userPass" );   //模拟取数据
//自动登录获取用户名和密码
if( $("#zidongDenglu").is(":checked") ){
	$(".inp1").focus(function(){
		$(".inp1").val( getUserName );
	});
	$(".inp2").focus(function(){
		$(".inp2").val( getUserPass );
	});
};
//验证码
function ranNum(min,max){
	return Math.floor( Math.random()*(max-min)+min );
};
$("#genghuan").click(function(){
	var arrZimu = ["a","b","c","d","e","f","g","h","i","j","k","l","m","n"];//26个字母 //13
	var yanNum = "";
	for(var i=0;i<4;i++){
		var inNumSui = ranNum(0,13);
		yanNum += arrZimu[inNumSui];
	};
	$(".yanPic").html( yanNum );
})

$( "#dengluBtn").click(function(){
	var inpUserName = $(".inp1").val();  //输入的登录账号
	var inpPass = $(".inp2").val();   //输入的登录密码
	var inpYan = $(".yanzhengma").val(); //输入的验证码
	
	if( inpUserName==getUserName && inpPass==getUserPass && inpYan==$(".yanPic").html() ){
//		alert("登录");
		window.location.href = "myFs.html";
	}else{
		if( inpYan==$(".yanPic").html() ){
			alert("用户不存在");
		}else{
			alert("验证码不正确");
		}
		

	}
})













//
//$(".inp1").blur(function(){
//	
//});
//$(".inp2").blur(function(){});
//$(".yanzhengma").blur(function(){});



	

